<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组</title>
</head>
<body>
<script type="text/javascript">
  //6.1数组的创建
  var arr1 = [];  //创建一个空数组
  var arr2 = [1,2,3,4,5];  //创建一个包含5个数字元素的数组
  var arr3 = ['a','b','c','d','e'];  //创建一个包含5个字符串元素的数组
  console.log(arr1);  //输出的结果包含 主键和对应值，还有长度
  console.log(arr2);  //(5) [1,2,3,4,5] 可展开查看详细数据
  console.log(arr3);  //(5) ['a','b','c','d','e'] 可展开查看详细数据
  //多维数组
  var arr4 = ['a','b','c'];  //一维数组
  var arr5 = ['a','b','c',['d','e']];  //二维数组
  var arr6 = ['a','b','c',['d','e',['f','g']]];  //三维数组
  console.log(arr4);  //(3) ['a','b','c']
  console.log(arr5);  //(3) ['a','b','c',Array(2)]
  console.log(arr6);  //(3) ['a','b','c',Array(2)]
  var arr1 = [1,1,1];
  var arr2 = [2,2,2];
  var arr3 = [3,3,3];
  var arr4 = [arr1, arr2, arr3];
  var arr5 = [arr1, arr2, arr3];
  var arr6 = [arr1, arr2, arr3];
  var arr7 = [arr4, arr5, arr6];
  console.log(arr4);  //(3) [Array(3),Array(3),Array(3)]
  console.log(arr7);  //(3) [Array(3),Array(3),Array(3)]
</script>
</body>
</html>